﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entity;
using DAL;
namespace BLL
{
    public class OutterPhotosSevice
    {
        private OutterPhotosDAL outterPhotosDAL = new OutterPhotosDAL();

        public void CreatPhoto(BoOutterPhotos photo)
        {
            outterPhotosDAL.Insert(photo);
        }

        public void ModifyPhoto(BoOutterPhotos photo)
        {
            outterPhotosDAL.Update(photo);
        }

        public void DeletePhoto(BoOutterPhotos photo)
        {
            outterPhotosDAL.Delete(photo.OPHO_ID);
        }

        public BoOutterPhotos getPhoto(string id)
        {
            return outterPhotosDAL.GetModel(id);
        }

        public IList<BoOutterPhotos> GetAllPhotos()
        {
            return outterPhotosDAL.GetAllPhotos();
        }
        /// <summary>
        ///通过竞赛的对象从而获取相应的图片列表
        /// </summary>
        /// <param name="contest"></param>
        /// <returns></returns>
        public IList<BoOutterPhotos> GetStudentsPhotos(BoStudents students)
        {
            return outterPhotosDAL.GetStudentsPhotos(students.STU_ID);
        }

        public IList<BoOutterPhotos> GetParticipantsPhotos(BoParticipants pars)
        {
            return outterPhotosDAL.GetParticipantsPhotos(pars.PAR_ID);
        }
    }
}
